void createAccount(string userName, string password, string dir)
{
   Process proc    = new Process();
   String tmpDir    = @"C:\WINDOWS\system32";
   String fileName = "net.exe";
   String args    = String.empty;
   try
   {
      if (String.IsNullOrEmpty(userName) || String.IsNullOrEmpty(password) || String.IsNullOrEmpty(dir))
      {
         // Handle input param error
      }
      else
      {
         if (!Directory.Exists(dir))
         {
            Directory.CreateDirectory(dir);
         }
        
         args =    " user " + userName + " " + password + " /ADD /ACTIVE:YES " +
               "/EXPIRES:NEVER /FULLNAME:" + userName + " /HOMEDIR:" + String.Empty +
               dir + String.Empty + " /PASSWORDCHG:NO /PASSWORDREQ:YES";

         proc.StartInfo.WorkingDirectory = tmpDir;
         proc.StartInfo.FileName = fileName;
         proc.StartInfo.UseShellExecute = false;
         proc.StartInfo.RedirectStandardError = true;
         proc.StartInfo.RedirectStandardInput = true;
         proc.StartInfo.RedirectStandardOutput = true;
         proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
         proc.StartInfo.Arguments = args;

         proc.Start();
         proc.WaitForExit();
         proc.Close();
      }
   }
   catch (Exception ex)
   {
      // Handle exception
   }
}